package com.ywk.pattern._14_observer._14_4;


import java.util.ArrayList;
import java.util.List;

public class Boss extends Subject {
    //同事列表
    private List<Observer> observerList = new ArrayList<>();

    //增加
    public void Attach(Observer observer) {

        observerList.add(observer);
    }

    //减少
    public void Detach(Observer observer) {
        observerList.remove(observer);
    }

    //通知
    public void Notify() {
        for (Observer stockObserver : observerList) {
            stockObserver.Update();
        }
    }
    //前台状态


    public String getAction() {
        return super.SubjectState;
    }

    public void setAction(String action) {
        super.SubjectState = action;
    }
}
